Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate metrics_view to explore resources (breaking) #5722

Merged
merged 8 commits into from
Oct 1, 2024

Conversation

begelundmuller
Copy link
Contributor

@begelundmuller begelundmuller commented Sep 18, 2024

NOTE: This PR is finished but awaiting frontend refactors.

This PR contains migrations and breaking API changes for the separation of metrics_view and explore resources. It should not be merged until the frontend has transitioned to consuming explore resources. It also requires the frontend to be adapted for the changed API signatures.

While this PR would break the current frontend, it does not contain any changes that are incompatible with previous CLI versions. So it is safe to merge once the frontend has been adapted for its changes.

Changes:

  • Adds version: 1 to the metrics view YAML generator.
  • Migrates all bookmarks with kind="rill.runtime.v1.MetricsView" to have kind="rill.runtime.v1.Explore".
  • Changes the magic auth token RPCs to have generic resource_type and resource_name properties instead of metrics_view. Specifically, the changes are:
    • resource_type: new field (set to rill.runtime.v1.Explore for existing rows)
    • resource_name: renamed from metrics_view
    • filter: renamed from metrics_view_filter
    • fields: renamed from metrics_view_fields
  • Changes the GetIFrame RPC to use a type parameter instead of kind since we prefer "type" in user-facing fields.
  • Changes the GetIFrame RPC to default to type="rill.runtime.v1.Explore" instead of type="rill.runtime.v1.MetricsView".

Frontend integration notes:

  • Create and consume bookmarks as pointing to explore resources instead of metrics view resources
  • Update the magic auth token RPC invocations to reflect the changed property names
  • Create and consume magic auth tokens as pointing to explore resources instead of metrics view resources
  • Update the embed page to accept explore resources instead of metrics views
  • When creating a metrics view YAML file, also create an explore YAML file (not sure where or what it should contain)

ericpgreen2 and others added 2 commits September 27, 2024 16:52
* Refactor StateManagers to use explore

* Replace useMetricsView - Pass 1

* Use explore in state defaults

* Add basic explore editor

* Replace metricViewName with exploreName where applicable in rill dev

* Update bookmarks

* Fix navigation on cloud

* Fix alerts and reports

* Migrate Public URLs

* Redirect old Explore URLs to `.../explore/[name]`

* Migrate embeds

* Fix syncDimensions

* Fix eslint

* Fix `svelte-check`

* `metricViewName` -> `metricsViewName`

* `useMetricsView` -> `useMetricsViewValidSpec`

* `useDashboard` -> `useMetricsView`

* `useDashboardStore` -> `useExploreStore`

* `useMetaMeasure` -> `useMetricsViewSpecMeasure`

* Add two `+page.ts` files to `tsc` whitelist

* Fix "Function called outside component initialization"

* Add Metrics View icon

* `MetricsExplorerIcon` -> `ExploreIcon`

* Fix unit tests - Pass 1

* Fix unit tests - Pass 2

* Fix unit tests - Pass 3

* Fix tsc

* Revise new files from "Add" button

* Better organization of `features/explores`, `features/metrics-views`

* Refactor `new-files.ts` to account for files bootstrapped from another resource

* Add "Create Explore dashboard" button to Metrics Workspace

* Nits

* "Generate dashboard" -> "Generate metrics"

* "DashboardMenuItems" -> "MetricsViewMenuItems"

* `useValidExplore` -> `useExploreValidSpec`

* `useValidDashboards` -> `useValidExplores`

* Add YAML syntax highlighting to `ExploreEditor`

* Partially fix Preview mode's Explore CTAs

* Explore E2E pass 1 - Fix model and explore editing

* Explore E2E pass 2 - Fix metrics editing in tests

* Explore E2E pass 3 - Fix metrics editor experience

* Fix eslint

* Explore E2E pass 3 - Fix incorrect test migration

* Avoid using useMetricsView

* Fix resource->resource navigation buttons

* Use the right icons

* Update e2e tests

* Fix missing icon

* Fix navigation through top nav bar

* Restore migration for billing table

---------

Co-authored-by: Eric P Green <[email protected]>
@AdityaHegde AdityaHegde merged commit 629ac62 into main Oct 1, 2024
10 checks passed
@AdityaHegde AdityaHegde deleted the begelundmuller/explore-resources-breaking branch October 1, 2024 10:17
k-anshul pushed a commit that referenced this pull request Oct 15, 2024
* Migrate `metrics_view` to `explore` resources (breaking)

* Self review

* Roll back docs changes

* Web: Migrate `metrics_view` to `explore` resources (#5724)

* Refactor StateManagers to use explore

* Replace useMetricsView - Pass 1

* Use explore in state defaults

* Add basic explore editor

* Replace metricViewName with exploreName where applicable in rill dev

* Update bookmarks

* Fix navigation on cloud

* Fix alerts and reports

* Migrate Public URLs

* Redirect old Explore URLs to `.../explore/[name]`

* Migrate embeds

* Fix syncDimensions

* Fix eslint

* Fix `svelte-check`

* `metricViewName` -> `metricsViewName`

* `useMetricsView` -> `useMetricsViewValidSpec`

* `useDashboard` -> `useMetricsView`

* `useDashboardStore` -> `useExploreStore`

* `useMetaMeasure` -> `useMetricsViewSpecMeasure`

* Add two `+page.ts` files to `tsc` whitelist

* Fix "Function called outside component initialization"

* Add Metrics View icon

* `MetricsExplorerIcon` -> `ExploreIcon`

* Fix unit tests - Pass 1

* Fix unit tests - Pass 2

* Fix unit tests - Pass 3

* Fix tsc

* Revise new files from "Add" button

* Better organization of `features/explores`, `features/metrics-views`

* Refactor `new-files.ts` to account for files bootstrapped from another resource

* Add "Create Explore dashboard" button to Metrics Workspace

* Nits

* "Generate dashboard" -> "Generate metrics"

* "DashboardMenuItems" -> "MetricsViewMenuItems"

* `useValidExplore` -> `useExploreValidSpec`

* `useValidDashboards` -> `useValidExplores`

* Add YAML syntax highlighting to `ExploreEditor`

* Partially fix Preview mode's Explore CTAs

* Explore E2E pass 1 - Fix model and explore editing

* Explore E2E pass 2 - Fix metrics editing in tests

* Explore E2E pass 3 - Fix metrics editor experience

* Fix eslint

* Explore E2E pass 3 - Fix incorrect test migration

* Avoid using useMetricsView

* Fix resource->resource navigation buttons

* Use the right icons

* Update e2e tests

* Fix missing icon

* Fix navigation through top nav bar

* Restore migration for billing table

---------

Co-authored-by: Eric P Green <[email protected]>

---------

Co-authored-by: Aditya Hegde <[email protected]>
Co-authored-by: Eric P Green <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants